<template>
	<view>
		<tiled :list="list" :hengNumber="3" @toDetailPage="toPage" backgroundColor="#87CEEB" nameColor="#fff" img_last="lg"></tiled>
		<ayAd :type="0" :showOffAt="true"></ayAd>
	</view>
	
</template>

<script>
	import ayAd from '@/components/ay-ad/ay-ad.vue';
	import tiled from '@/components/ay-shortcutNav/tiled.vue';
	export default {
		components:{
			tiled,
			ayAd,
		},
		data() {
			return {
				list : [],
				isLoaded : false ,
			}
		},
		onLoad(options) {
			let that = this;
			
			let data = options.data ? JSON.parse(decodeURIComponent(options.data)) : false;
			//console.log(JSON.stringify(data))
			//console.log(data)
			if (data) {
				that.setDate_init(data);
			}
			
			
			//that.loadData();
		},
		// #ifdef MP-WEIXIN
		//微信小程序的分享
		onShareAppMessage: function(options) {
		
		},
		// #endif
		methods: {
			setDate_init(data) {
				let that = this;
				uni.setNavigationBarTitle({
					title: data.name
				})
			
				that.type = data.type;
				that.list = data.item;
				//console.log(that.list )
			},
			toPage(e) {
				//console.log(e)
				let item = e.item ;
				
				//console.log("组件：", item.type)
				
				uni.navigateTo({
					url: `/pagesSEffect/index/show` + `?data=${encodeURIComponent(JSON.stringify(item))}`,
				})
				
			},
		},
	}
</script>

<style  lang="scss">
	
</style>
